#!/usr/bin/python


from pyfuncs import *
import dbus



import logging

# %(asctime)s
logging.basicConfig(level=logging.DEBUG, format='%(levelname)-8s %(name)-24s l%(lineno)-5d %(message)s', datefmt='%y-%m-%d %H:%M')

# partially disable the loggers for xpcom (and sons: xpcom.nsdom for example)
logging.getLogger("xpcom").setLevel(logging.WARNING)



# Node types
NODE_EMPTY = 0 			# node = [0, ?, ?, ?]
NODE_RESOURCE = 1		# node = [1, uri, ?, ?]
NODE_LITERAL = 2		# node = [2, literal_value, language, ?]
NODE_BLANK = 3			# node = [3, identifier_string, ?, ?]


USERNAME = "njean@mandriva.com"
# TODO: retrieve the user's name...
DEFAULT_ONTOLOGY_NAME = "own"
DEFAULT_ONTOLOGY_URI = makeOntologyUriFromUserId(USERNAME, DEFAULT_ONTOLOGY_NAME)


# Facilities
EMPTY_NODE = dbus.Struct([NODE_EMPTY, "", "", DEFAULT_ONTOLOGY_URI])



# http PATHs to different standards
PATH_NEPOMUK = "nepomuk:/"
# PATH_RDF = "http://www.w3.org/TR/rdf-syntax-grammar#"
PATH_RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
# PATH_RDFS = "http://www.w3.org/TR/rdf-schema#"
PATH_RDFS = "http://www.w3.org/2000/01/rdf-schema#"
# PATH_NAO = "http://www.semanticdesktop.org/ontologies/nao#"
PATH_NAO = "http://www.semanticdesktop.org/ontologies/2007/08/15/nao#"
PATH_NRL = "http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#"
# PATH_XMLSCHEMA = "http://www.w3.org/TR/xmlschema-1#"
PATH_XMLSCHEMA = "http://www.w3.org/2001/XMLSchema#"
PATH_XMLSCHEMA2 = "http://www.w3.org/TR/xmlschema-2#"
	# TODO: this URL may be changed because it is not recognized by soprano...
PATH_PIMO = "http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#"
# PATH_PIMO = "http://ontologies.opendfki.de/repos/ontologies/pim/pimo#"
PATH_PROTEGE = "http://protege.stanford.edu/system#"

# not in use yet
PATH_XESAMCORE = "http://freedesktop.org/standards/xesam/1.0/core#"
PATH_XESAMSCHEMA = "http://freedesktop.org/standards/xesam/1.0/schema#"



# different type formats
RDF_TYPE = PATH_RDF + "type"
RDF_PROPERTY = PATH_RDF + "Property"

RDFS_SUBCLASSOF = PATH_RDFS + "subClassOf"
RDFS_COMMENT = PATH_RDFS + "comment"
RDFS_DOMAIN = PATH_RDFS + "domain"
RDFS_RANGE = PATH_RDFS + "range"
RDFS_SUBPROPERTYOF = PATH_RDFS + "subPropertyOf"
RDFS_LABEL = PATH_RDFS + "label"

NAO_TAG = PATH_NAO + "Tag"
NAO_CREATED = PATH_NAO + "created"
NAO_PREFLABEL = PATH_NAO + "prefLabel"
NAO_HASTAG = PATH_NAO + "hasTag"
NAO_ISTAGFOR = PATH_NAO + "isTagFor"
NAO_DESCRIPTION = PATH_NAO + "description"
NAO_NUMERICRATING = PATH_NAO + "numericRating"
NAO_STATUS = PATH_NAO + "status"
NAO_HASDEFAULTNAMESPACEABBREVIATION = PATH_NAO + "hasDefaultNamespaceAbbreviation"

NRL_ONTOLOGY = PATH_NRL + "Ontology"
NRL_INSTANCEBASE = PATH_NRL + "InstanceBase"

XMLSCHEMA_STRING = PATH_XMLSCHEMA + "string"
XMLSCHEMA_DATETIME = PATH_XMLSCHEMA + "dateTime"
XMLSCHEMA_DECIMAL = PATH_XMLSCHEMA2 + "decimal"

PIMO_THING = PATH_PIMO + "Thing"
PIMO_WEBPAGE = PATH_PIMO + "Webpage"

PIMO_GROUNDINGOCCURRENCE = PATH_PIMO + "groundingOccurrence"

PIMO_DESCRIBINGPROPERTY = PATH_PIMO + "describingProperty"
PIMO_PARTOF = PATH_PIMO + "partOf"
PIMO_HASTOPIC = PATH_PIMO + "hasTopic"
PIMO_RELATED = PATH_PIMO + "isRelated"
PIMO_HASPART = PATH_PIMO + "hasPart"
PIMO_ISTOPICOF = PATH_PIMO + "isTopicOf"

INVERSE = {
	PIMO_PARTOF: PIMO_HASPART,
	PIMO_HASTOPIC: PIMO_ISTOPICOF,
	PIMO_RELATED: PIMO_RELATED,
	PIMO_HASPART: PIMO_PARTOF,
	PIMO_ISTOPICOF: PIMO_HASTOPIC
}

PROTEGE_INVERSEPROPERTY = PATH_PROTEGE + "inverseProperty"

# not in use (yet?)
XESAMCORE_URL = PATH_XESAMCORE + "url"
PATH_XESAMSCHEMA_URL = PATH_XESAMSCHEMA + "Url"


# Query languages
QUERYLANG_SPARQL = "SPARQL"

